package org.halk.model;

import lombok.Data;
import org.halk.constants.EsConsts;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.*;

import java.util.Date;

@Document(indexName = "txt_file")
@Data
public class TxtFile {
    @Id
    private String id;

    @Field(type = FieldType.Keyword)
    private String fileName;

    @Field(type = FieldType.Keyword)
    private String chapterName; // 新增：章节名称

    @Field(type = FieldType.Integer)
    private Integer lineNumber; // 新增：行号;

    @Field(
            type = FieldType.Text,
            analyzer = "ik_smart",
            termVector = TermVector.with_positions_offsets
    )
    private String content;

    @Field(type = FieldType.Date, format = DateFormat.date)
    private Date uploadTime;
}